//mui的toast
function mymui(msg) {
	mui.toast(msg, {
		duration: 'short',
		type: 'richtext' //解决有的手机前面显示应用名称的问题
	})
}

mui.postJSON = function(url, data, callback) {
	mui.ajax({
		url: url,
		type: 'POST',
		timeout: 20000,
		data: data ? data : null,
		dataType: "json",
		headers: {
			'Content-Type': 'application/json',
			'charset': 'utf-8'
		},
		success: function(result) {
			if(callback && typeof callback === "function") {
				callback(result);
			}
		},
		error: function(xhr, type, errorThrown) {
			mymui("网络异常：" + type);
		}
	});
}

mui.postParam = function(url, data, callback) {
	mui.ajax({
		url: url,
		type: 'POST',
		timeout: 20000,
		data: data ? data : null,
		dataType: "json",
		headers: {
			'charset': 'utf-8',
		},
		success: function(result) {
			if(callback && typeof callback === "function") {
				callback(result);
			}
		},
		error: function(xhr, type, errorThrown) {
			mymui("网络异常：" + type);
		}
	});
}